package twiter.snowflake;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SnowflakeIdFactoryTest {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext(
                "classpath:spring-bean.xml");

        SnowflakeIdFactory snowflakeIdFactory = context.getBean("snowflakeIdFactory", SnowflakeIdFactory.class);
        for (int i = 0; i < 100; i++) {
            System.out.println(snowflakeIdFactory.nextId());
        }
    }
}
